//
//  HttpUrlConfig.h
//  GasEasyPay
//
//  Created by 张宁宁 on 16/6/13.
//  Copyright © 2016年 lirenkj. All rights reserved.
//

#ifndef HttpUrlConfig
#define HttpUrlConfig

#define httpToken [[NSUserDefaults standardUserDefaults] objectForKey:@"token"]
#define httpDomain [[NSUserDefaults standardUserDefaults] objectForKey:@"domain"]
#define rongCloudTokenMacro [[NSUserDefaults standardUserDefaults] objectForKey:@"rongCloudToken"]
#define bannerShow [[[NSUserDefaults standardUserDefaults] objectForKey:@"banner"] boolValue]
#define userAvaterURL [[NSUserDefaults standardUserDefaults] objectForKey:@"userAvater"]
#define userNickName [[NSUserDefaults standardUserDefaults] objectForKey:@"userNickName"]

/**登录*/
#define loginURL @"/api/account/login"

/**退出登录*/
#define logoutURL [NSString stringWithFormat:@"/api/account/logout?token=%@",httpToken]

/**注册*/
#define registerURL @"/api/account/register"

/**找回密码*/
#define findPasswordsURL @"/api/account/password/forget"

/**修改密码*/
#define changePasswordsURL @"/api/account/password"

/**获取验证码 action标识（注册：register，修改/找回密码：password）*/
#define getTestCode(phone,action) [NSString stringWithFormat:@"/api/account/code?phone=%@&action=%@",phone,action]

/**校验验证码*/
#define checkTestCode @"/api/account/checkCode"

/**更换手机号*/
#define changePhoneURL [NSString stringWithFormat:@"/api/account/changePhone?token=%@",httpToken]

/**用户协议*/
#define userAgreementURL @"/api/settings/agreement"

/**个人用户个人中心*/
#define personMyCenterURL [NSString stringWithFormat:@"/api/personal?token=%@",httpToken]
/**机构用户个人中心*/
#define unitMyCenterURL [NSString stringWithFormat:@"/api/org?token=%@",httpToken]

/**我的评论*/
#define myCommentURL(token,pageNum,iDisplayLength) [NSString stringWithFormat:@"/api/comment/list?token=%@&pageNum=%@&iDisplayLength=%@",token,pageNum,iDisplayLength]
/**我的评论删除*/
#define deleteMyCommentURL(id) [NSString stringWithFormat:@"/api/comment/%ld?token=%@",id,httpToken]

/**个人用户资料*/
#define personInfoURL [NSString stringWithFormat:@"/api/personal/info?token=%@",httpToken]
/**编辑个人用户资料*/
#define updatepersonInfoURL [NSString stringWithFormat:@"/api/personal/info?token=%@",httpToken]
/**机构用户资料*/
#define unitInfoURL [NSString stringWithFormat:@"/api/org/info?token=%@",httpToken]
/**编辑机构用户资料*/
#define updateUnitInfoURL [NSString stringWithFormat:@"/api/org/info?token=%@",httpToken]

/**机构认证获取验证码*/
#define getCertifyTestCode(phone) [NSString stringWithFormat:@"/api/org/code?token=%@&phone=%@",httpToken,phone]
/**机构申请认证*/
#define certifyURL [NSString stringWithFormat:@"/api/org/authentication?token=%@",httpToken]
/**机构已认证*/
#define certifyDoneURL [NSString stringWithFormat:@"/api/org/authentication/success?token=%@",httpToken]

/**意见反馈*/
#define feedbackURL [NSString stringWithFormat:@"/api/feedback?token=%@",httpToken]

/**图片上传*/
#define uploadPictureURL [NSString stringWithFormat:@"/api/image/upload?token=%@",httpToken]


/**首页接口*/
#define mainURL [NSString stringWithFormat:@"/api/index?token=%@",httpToken]

/**搜索接口*/
#define searchURL [NSString stringWithFormat:@"/api/search?token=%@",httpToken]

//10 设备 11服务 14专长 15题材
#define getTypeURL(type) [NSString stringWithFormat:@"/api/typeList?token=%@&type=%@",httpToken,type]

//获取设备服务 列表服务接口

#define getDeviceAndServcieListURL [NSString stringWithFormat:@"/api/resourceInfo/list?token=%@",httpToken]

//设备/服务详情
#define getDeviceAndServcieDetailsURL(serviceordiviceid) [NSString stringWithFormat:@"/api/resourceInfo/%@?token=%@",serviceordiviceid,httpToken]

//收藏取消收藏 resourcesTypeId 10项目 11服务 12人脉 13设备  resourcesId 项目/服务/人脉/设备 id
#define doCollectionURL [NSString stringWithFormat:@"/api/collect?token=%@",httpToken]

//人脉列表
#define getContactsURL [NSString stringWithFormat:@"/api/personal/list?token=%@",httpToken]

//发表评论
#define addCommentURL [NSString stringWithFormat:@"/api/comment/add?token=%@",httpToken]
//评论列表
#define commentURL(projectid) [NSString stringWithFormat:@"/api/comment/list/%@?token=%@",projectid,httpToken]

//机构详情
#define orgDetailsURL(id) [NSString stringWithFormat:@"/api/org/%@?token=%@",id,httpToken]

//获取项目列表
#define getProjectListURL [NSString stringWithFormat:@"/api/projectInfo/list?token=%@",httpToken]
///
//获取项目详情
#define getProjectDetailsURL(id) [NSString stringWithFormat:@"/api/projectInfo/%@?token=%@",id,httpToken]

//获取个人信息详情
#define getUserInfoURL(id) [NSString stringWithFormat:@"/api/personal/%@?token=%@",id,httpToken]

//获取详情评论列表
#define getCommentListURL(id) [NSString stringWithFormat:@"/api/comment/list/%@?token=%@",id,httpToken]

//删除设备服务
#define deleteDevice(id) [NSString stringWithFormat:@"/api/resourceInfo/delete/%@?token=%@",id,httpToken]

//删除项目
#define deleteProject(id) [NSString stringWithFormat:@"/api/projectInfo/delete/%@?token=%@",id,httpToken]

/**************************************************  工作台接口 **************************************************/
//核对用户或机构信息是否完善
#define CheckInfo @"/api/account/isComplete"
//获取项目详情
#define GetProjectInfo(id) [NSString stringWithFormat:@"/api/projectInfo/%@",id]
//获取类型列表
#define GetTypeList @"/api/typeList"
//发布项目接口
#define PublishProject [NSString stringWithFormat:@"/api/projectInfo/saveOrUpdate?token=%@",httpToken]
//获取设备或服务详情
#define GetDeviceOrServiceDetailInfo(id) [NSString stringWithFormat:@"/api/resourceInfo/%@",id]
//发布设备或服务
#define PublishDeviceOrService [NSString stringWithFormat:@"/api/resourceInfo/saveOrUpdate?token=%@",httpToken]
//我收藏的设备列表接口、我收藏的服务列表接口、设备管理列表、服务管理列表接口
#define MyCollectionDeviceOrServiceList @"/api/resourceInfo/list"
//取消收藏的接口
#define CancelCollect [NSString stringWithFormat:@"/api/collect?token=%@",httpToken]
//我收藏的项目列表接口、项目管理列表
#define MyCollectionProjectList @"/api/projectInfo/list"
//我收藏的人脉列表接口
#define MyCollectionConnectionList @"/api/personal/list"
//删除我的项目
#define DeleteMyProject(id) [NSString stringWithFormat:@"/api/projectInfo/delete/%@",id]
//删除我的设备或者服务
#define DeleteMyDeviceOrService(id) [NSString stringWithFormat:@"/api/resourceInfo/delete/%@",id]
/**************************************************  消息接口 **************************************************/
//获取融云token
#define GetRongCloudToken [NSString stringWithFormat:@"/api/im/rongToken?token=%@",httpToken]
//获取用户信息
#define GetUserInfo(id) [NSString stringWithFormat:@"/api/im/user/%@?token=%@",id,httpToken]
#endif
